package com.example.xutildemoproject.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

import androidx.annotation.Nullable;

import com.example.xutildemoproject.R;
import com.example.xutildemoproject.base.BaseActivity;
import com.xuexiang.xpage.base.XPageActivity;
import com.xuexiang.xutil.app.IntentUtils;

import butterknife.BindView;
import butterknife.OnClick;

public class TestRouterActivity extends BaseActivity {
    @BindView(R.id.tv_content)
    TextView tvContent;
    @BindView(R.id.back)
    Button btnBack;
    private String param;


    @Override
    protected void initListeners() {

    }

    @Override
    protected void initViews() {
        tvContent.setText("参数1:" + IntentUtils.getStringExtra(getIntent(),"param1")
                + ", 参数2:" + IntentUtils.getIntExtra(getIntent(),"param2",0));
    }

    @Override
    protected void initArgs() {

    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_test_router;
    }

    @OnClick(R.id.back)
    protected void onViewClicked(View view){
        switch (view.getId()) {
            case R.id.back:
                Intent intent = new Intent();
                IntentUtils.putExtra(intent,"back","返回的是1111");
                setResult(RESULT_OK,intent);
                finish();
                break;
            default:
                break;
        }
    }
}
